package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CommounityChargeMapper;
import com.ruoyi.system.domain.CommounityCharge;
import com.ruoyi.system.service.ICommounityChargeService;

/**
 * chargeService业务层处理
 *
 * @author wanglong
 * @date 2024-03-24
 */
@Service
public class CommounityChargeServiceImpl implements ICommounityChargeService
{
    @Autowired
    private CommounityChargeMapper commounityChargeMapper;

    /**
     * 查询charge
     *
     * @param chargeId charge主键
     * @return charge
     */
    @Override
    public CommounityCharge selectCommounityChargeByChargeId(Long chargeId)
    {
        return commounityChargeMapper.selectCommounityChargeByChargeId(chargeId);
    }

    /**
     * 查询charge列表
     *
     * @param commounityCharge charge
     * @return charge
     */
    @Override
    public List<CommounityCharge> selectCommounityChargeList(CommounityCharge commounityCharge)
    {
        return commounityChargeMapper.selectCommounityChargeList(commounityCharge);
    }



    /**
     * 新增charge
     *
     * @param commounityCharge charge
     * @return 结果
     */
    @Override
    public int insertCommounityCharge(CommounityCharge commounityCharge)
    {
        commounityCharge.setCreateTime(DateUtils.getNowDate());
        commounityCharge.setCreateBy(SecurityUtils.getUsername());
        return commounityChargeMapper.insertCommounityCharge(commounityCharge);
    }

    /**
     * 修改charge
     *
     * @param commounityCharge charge
     * @return 结果
     */
    @Override
    public int updateCommounityCharge(CommounityCharge commounityCharge)
    {
        commounityCharge.setUpdateTime(DateUtils.getNowDate());
        return commounityChargeMapper.updateCommounityCharge(commounityCharge);
    }

    /**
     * 批量删除charge
     *
     * @param chargeIds 需要删除的charge主键
     * @return 结果
     */
    @Override
    public int deleteCommounityChargeByChargeIds(Long[] chargeIds)
    {
        return commounityChargeMapper.deleteCommounityChargeByChargeIds(chargeIds);
    }

    /**
     * 删除charge信息
     *
     * @param chargeId charge主键
     * @return 结果
     */
    @Override
    public int deleteCommounityChargeByChargeId(Long chargeId)
    {
        return commounityChargeMapper.deleteCommounityChargeByChargeId(chargeId);
    }


}
